package _022_2_15

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

type Order struct {
	id    int
	v     int
	w     int
	price int
}

func main() {
	n, m := 0, 0
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &n, &m)

	orders := make([]*Order, n)

	for i := 0; i < n; i++ {
		v, w := 0, 0
		fmt.Fscan(in, &v, &w)
		orders[i] = &Order{i, v, w, v + w*2}
	}

	sort.Slice(orders, func(i, j int) bool {
		if orders[i].price < orders[j].price {
			return true
		}

		if orders[i].price == orders[j].price && orders[i].id < orders[i].id {
			return true
		}

		return false
	})

	res := make([]int, 0)
	for i := 0; i < m; i++ {
		res = append(res, orders[len(orders)-1-i].id)
	}
	sort.Ints(res)

	for i := 0; i < len(res); i++ {
		fmt.Print(res[i], " ")
	}
	fmt.Println()
}
